/**
 * 功能描述
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/membertransfer_main.tpl");
    require("./assets/css/membertransfer_main.css");

    //business

    //component
    var MemTransferSubnav = require("./component/MemTransferSubnav");
    var MemTransferGrid = require("./component/MemTransferGrid");
    var MemTransferEndForm = require("./component/MemTransferEndForm");
    var MemTransferSubGrid = require("./component/MemTransferSubGrid");
    //constant
    var constant = require("./constant/MenTransferConstant");
    //handler
    var handler = require("./handler/MemTransferEvents");
    //store

    var service = require("./service/MemTransferSvc");
    
    var App = ELView.extend({
        attrs: {
            template: template
        },
        constant: constant,
        handler: handler,
        service: service,
        initComponent: function (params, widget) {
        	MemTransferSubnav.initComponent(params,widget);
        	MemTransferGrid.initComponent(params,widget);
        	MemTransferSubGrid.initComponent(params,widget);
        	MemTransferEndForm.initComponent(params,widget);
        	
        },
        afterInitComponent: function (params, widget) {
            
        },
        toGrid: function(){
        	$(".J-form").empty();
        	this.get("endForm").reset();
        	this.get("subGrid").setData("");
        	this.show([".J-grid"]).hide([".J-form",".J-endForm",".J-subGrid"]);
			this.get("subnav").hide(["back"]).show(["add","search","dateRange"]);
        },
        toForm: function(){
        	this.get("form").reset();
        	this.get("endForm").reset();
        	this.get("subGrid").setData("");
        	this.show([".J-form",".J-endForm",".J-subGrid"]).hide([".J-grid"]);
			this.get("subnav").hide(["add","search","dateRange"]).show(["back"]);			
			
        }
    });

    module.exports = App;
});
